package com.jing.weibo.ws.sina;

import org.springframework.stereotype.Component;

import weibo4j.Comments;
import weibo4j.model.CommentWapper;
import weibo4j.model.Paging;
import weibo4j.model.WeiboException;

/**
 * Comments[评论]新浪微博的接口
 * @author jing.yue
 * @version 2012/08/29 1.0.0
 */
@Component
public class CommentsService {

	/**
	 * 获取最新的提到当前登录用户的评论，即@我的评论
	 * @param page
	 * @param count
	 * @param token
	 * @return
	 * @throws WeiboException
	 */
	public CommentWapper getCommentMentions(Integer page, Integer count, String token) throws WeiboException {
		Comments comments = new Comments();
		comments.setToken(token);
		Paging paging = new Paging();
		paging.setCount(count);
		paging.setPage(page);
		return comments.getCommentMentions(paging, 0, 0);
	}
	
	/**
	 * 获取当前登录用户所接收到的评论列表
	 * @param page
	 * @param count
	 * @param token
	 * @return
	 * @throws WeiboException
	 */
	public CommentWapper getCommentToMe(Integer page, Integer count, String token) throws WeiboException {
		Comments comments = new Comments();
		comments.setToken(token);
		Paging paging = new Paging();
		paging.setCount(count);
		paging.setPage(page);
		return comments.getCommentToMe(paging, 0, 0);
	}
}
